const fs = require('fs');
const path = require('path');
console.log(__dirname);
console.log(path.join(__dirname,'test3.txt'));
const fileName = path.join(__dirname,'test3.txt');

// D:\上课录频\node代码\learn-node
// D:\上课录频\node代码\learn-node\test3.txt
// <Buffer e6 b5 8b e8 af 95 e7 ae 80 e5 8d 95 e5 86 99 e5 85 a5>
// 测试简单写入

fs.readFile(fileName,{flag:'r'},(err,data)=>{
    if(!err){
        console.log(data);
        console.log(data.toString());
    }else{
        console.log(err);
    }
})